package rad.framework.conv;

import rad.framework.conv.ExportCommand;
import rad.framework.conv.Controller;
import java.util.Set;
import rad.framework.conv.Controller;

import rad.framework.jpa.JpaUtil;

public class ExportController extends Controller {

	public ExportController(String path, String names) {
		super(path, names);
	}

	public ExportController(String path) {
		super(path);
	}

	protected void init() {
		try {
			Set<String> names = JpaUtil.getEntityNames("java:/rad-framework-commons");
			for (String name : names) {
				name = name.substring(name.lastIndexOf(".") + 1);
				addEntity(name, new ExportCommand("from " + name,
						"java:/rad-framework-commons", name, true, ""));
			}
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}
}
